<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2019/1/9
 * Time: 21:25
 */
$http_server=new swoole_http_server('0.0.0.0',8811);


$http_server->set([
    'enable_static_handler' => true,
    'document_root' => '/apps/wwwroot/swoole/data'
]);



$http_server->on('request',function ($request,$response){
    print_r($request->get);
    $response->cookie('sessionID',base64_encode(md5(123)),time()+3600);
    $response->end("<h1>HTTPServer</h1>".json_encode($request->get));
});
$http_server->start();